<template>

    <el-table :data="filteredTableData" stripe border style="width: 100%" clearable>
      <el-table-column prop="sno" label="学号" sortable auto width="150"  />
      <el-table-column prop="sname" label="姓名" width="180" />
      <el-table-column prop="sgrade" label="年级" width="100" />
      <el-table-column prop="stotal" label="综合成绩" width="100" />
      <el-table-column prop="isprice" label="获奖"  width="200" />

    </el-table>
    <div style="margin: 10px; position: fixed; top: 600px;left: 200px; ">
      <el-pagination
          :page-size="pageSize"
          :current-page="currentPage"
          layout=" sizes, prev, pager, next, jumper"
          :total="total"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
      />

  </div>
</template>
<script>



import request from "../../utils/request"; //!!!!!!!

export default {
  name: 'Price',
  components: {

  },
  data(){
    return{
      form:{},
      dialogVisible:false,
      search:'',
      pageSize:10,
      currentPage:1,
      total:0,
      tableData: []
    }
  },
  computed: {
    filteredTableData() {
      return this.tableData.filter(item => item.isprice === "国家级"||item.isprice === "校级"||item.isprice === "省级");
    }
  },
  created(){
    this.load()
  },
  methods:{
    load(){
      request.get("/users",{
        params: {
          pageNum: this.currentPage,
          pageSize: this.pageSize,
          search: this.search
        }
      }).then(res => {
        console.log(res)
        this.tableData = res.data.records
        // this.total = res.data.total
      })
    },

    handleSizeChange(pageSize){
      this.pageSize = pageSize
      this.load()
    },
    handleCurrentChange(pageNum){
      this.currentPage = pageNum
      this.load()
    },

  }
}
</script>
<script setup>
</script>